
<script type="text/javascript">
    function handle_toggle(toggle_id){
        //alert('aaaaaaa');
        var select_id = 'toggle_' + toggle_id;
         var myVerticalSlide = new Fx.Slide(select_id);
         myVerticalSlide.toggle();
   }; 
   function handle_toggle_out(){
        $$('.all_element').each(function(el){
        var myVerticalSlide = new Fx.Slide(el);
        myVerticalSlide.slideOut();
    });
   };
   function handle_toggle_in(){
        $$('.all_element').each(function(el){
        var myVerticalSlide = new Fx.Slide(el);
        myVerticalSlide.slideIn();
    });
   };
</script>
<?php
if(count($this->result) > 0):
?>
<div style="margin-top: 20px;">
<div style="margin-bottom: 10px;">
<span><a   style="text-decoration: none;" href="javascript:void(0);"  onclick="handle_toggle_in(); return false;" title="<?php echo $this->translate('Expand All'); ?>"><?php echo $this->translate('Expand All'); ?></a></span> | 
<span><a  style="text-decoration: none;" href="javascript:void(0);"  onclick="handle_toggle_out(); return false;" title="<?php echo $this->translate('Collapse All'); ?>"><?php echo $this->translate('Collapse All'); ?></a></span>
</div>
<?php 
foreach($this->result as $item):
?>
<ul>
    <li>
        <div class="div_title"><h4><a  style="text-decoration: none;" href="javascript:void(0);"  onclick="handle_toggle(<?php echo $item->getIdentity(); ?>); return false;"><?php echo $item->title; ?></a></h4></div>
        <div id="toggle_<?php echo $item->getIdentity(); ?>" class="all_element" >
            <?php echo $item->detail; ?>
        </div>
    </li>
</ul>
<?php 
endforeach;
endif; ?>
</div>
<script type="text/javascript">
window.addEvent('domready', function(){
    $$('.all_element').each(function(el){
        var myVerticalSlide = new Fx.Slide(el);
        myVerticalSlide.slideOut();
    });
});
</script>
<style>
.div_title{
    background-color: #E2EBD6;
}
</style>
